class CreateIssueChanges < ActiveRecord::Migration
  def self.up
    create_table :issue_changes do |t|
      t.integer :comment_id
      t.string  :type

      # IssueAttrChange
      t.string :attr
      t.string :from_str
      t.string :to_str

      # IssueRefChange
      t.references :changed_from, :polymorphic => true
      t.references :changed_to, :polymorphic => true
    end
  end

  def self.down
    drop_table :issue_changes
  end
end
